home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / foundation / NSZone.h < prev   
Text File  |  1994-04-11  |  1KB  |  48 lines

  1. /*    NSZone.h
  2.     Allocation of large regions
  3.       Copyright 1994, NeXT, Inc.
  4.     NeXT, March 1994
  5. */
  6.  
  7. #import <objc/objc.h>
  8.  
  9. @class NSString;
  10.  
  11. /***************    NSZone definition        ***************/
  12.  
  13. typedef struct _NSZone NSZone;
  14.  
  15. /***************    Operations on zones        ***************/
  16.  
  17. extern NSZone *NSDefaultMallocZone(void);
  18.     /* Returns the default zone used by the malloc(3) calls. */
  19.  
  20. extern NSZone *NSCreateZone(unsigned startSize, unsigned granularity, BOOL canFree);
  21.     /* Create a new zone with its own memory pool. If canfree is 0 the allocator will never free memory and mallocing will be fast */
  22.  
  23. extern void NSRecycleZone(NSZone *zone);
  24.     /* Adds the pages still in use to the default zone */
  25.     
  26. extern void NSSetZoneName(NSZone *zone, NSString *name);
  27.     /* Sets the zone name */
  28.  
  29. extern NSString *NSZoneName(NSZone *zone);
  30.     /* Gets the name of a zone */
  31.     
  32. /***************    Operations on pointers in zones        ***********/
  33.  
  34. extern void *NSZoneMalloc(NSZone *zone, unsigned size);
  35.     /* Allocates in zone */
  36.  
  37. extern void *NSZoneRealloc(NSZone *zone, void *ptr, unsigned size);
  38.     /* Resizes in zone; ptr passed in may be NULL */
  39.  
  40. extern void NSZoneFree(NSZone *zone, void *ptr);
  41.     /* Recycles the memory */
  42.  
  43. extern void *NSZoneCalloc(NSZone *zone, unsigned numElems, unsigned byteSize);
  44.     /* Like NSZoneMalloc and then bzero. */
  45.  
  46. extern NSZone *NSZoneFromPtr(void *ptr);
  47.     /* Returns the zone for a malloced or realloced pointer, NULL if not in any zone. */
  48.